package com.xyc.task.controller;

import com.xyc.task.service.AsyncService;
import com.xyc.task.service.ScheduledService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AsyncController {
    @Autowired
    AsyncService asyncService;

    @Autowired
    ScheduledService scheduledService;

    @GetMapping("/async")
    public String async() {
        asyncService.asy();
        return "async success";
    }

    @GetMapping("/sch")
    public String sch(){
        scheduledService.schedule();
        return "schedule success";
    }
}
